<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>

<%@ taglib prefix="s" uri="/struts-tags" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
    	<link rel="stylesheet" type="text/css" media="all" href="<s:url value='/css/main.css'/>" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Aplicação</title>
        <style type="text/css">
<!--
.style1 {font-size: 14px}
.style3 {font-size: 18px}
-->
        </style>
</head>
    <body>
    <div id="tudo">
<div id="conteudo">
<s:form action="Avalia!execute.do" method="POST">
  <div align="center"><h1>Avaliação de Trabalhos</h1></div>
  <table width="459" border="0" align="center" cellpadding="0" cellspacing="4">
    <tr>
	   <td colspan="2">
	         <s:actionerror />
	         <s:actionmessage/>
	         <s:fielderror />
	   </td> 
   </tr>    
    <tr>
    		<s:textfield name="nomeAluno" size="40" maxlength="100" label="Avaliador" disabled="true"></s:textfield>
    		<s:hidden name="idAluno"></s:hidden>
    		
    		<s:textfield name="codTurma" size="20" maxlength="100" label="Turma" disabled="true"></s:textfield>
    		<s:hidden name="idTurma"></s:hidden>   
			
			<s:textfield name="nomeTarefa" size="40" maxlength="100" label="Tarefa" disabled="true"></s:textfield>
    		<s:hidden name="idTarefa"></s:hidden>   
    		
	      	<s:select name="idPostado" 
	      			label="Trabalhos"
	          		headerValue="--- Escolha um Trabalho ---" 
	    	  		headerKey="0" list="postados" listKey="id" listValue="nomeArquivo"/>    		
    </tr>
	
    <tr>
    	<td>
	        <s:textfield name="nota01" size="10" maxlength="4" label="1a Nota" value="%{getText('format.nota',{nota01})}"></s:textfield>
	        <s:textfield name="nota02" size="10" maxlength="4" label="2a Nota" value="%{getText('format.nota',{nota02})}"></s:textfield>
	        <s:textfield name="nota03" size="10" maxlength="4" label="3a Nota" value="%{getText('format.nota',{nota03})}"></s:textfield>	        
        </td>
    </tr>  
    <tr>
    	 <s:select name="idAvalia" list="avalias" listKey="id" listValue="postado.nomeArquivo" size="10" label="Avaliados"></s:select>
    </tr>
	<tr>
		<td colspan="5" rowspan="2" valign="bottom" align="center"> 
        	<input type="submit" name="adicionar" id="adicionar" value="Adicionar" />
        	<input type="submit" name="consultar" id="consultar" value="Consultar" />
        	<input type="submit" name="editar" id="editar" value="   Editar  " />
        	<input type="submit" name="remover" id="remover" value=" Remover" />
        	<input type="submit" name="menu" id="menu" value=" Menu " />
    	</td>
    </tr>
    <tr><td><p>&nbsp;</p></td></tr>
    
    <s:if test="postados != null">
    <tr><td><p>&nbsp;</p></td></tr>
	    <tr>
	    	<td  colspan="4">
	    		<table align="center" cellpadding="4" cellspacing="4">
	    			<th>Nome</th>
	    			<th>Visualizar</th>
	    			<s:iterator value="postados">
	    			<tr>
	    				<td><s:property value="nomeArquivo"/> </td>
	    				<s:url id="downloadDocumento" action="Avalia!baixarArquivoAnexo"><s:param name="idPostado" value="id"/></s:url>	 
	    				<td><s:a theme="ajax" href="%{downloadDocumento}">Download</s:a></td>   			  
	    			</tr> 				
	    			</s:iterator>
	    		</table>
	    	</td>	    
    </s:if>	     
  </table>
  
   
</s:form>
</div>
</div>
</body>
</html>
